package fileby.model.impl.sources.impl;

import fileby.model.impl.sources.impl.AbstractFileSource;
import fileby.core.SourceType;
import fileby.core.IDisplayableFileSource;
import java.io.File;
import java.io.IOException;
import java.util.List;

/**
 *
 * @author Ludwig Kjellstrom
 */
public class MockObjectFactory {

    public static AbstractFileSource create() {
        return create(null,null);
    }

    public static AbstractFileSource create(SourceType type){
        return create(type,null);
    }

    public static AbstractFileSource create(SourceType type, String parameter){
        return new AbstractFileSourceImpl(type,parameter);
    }
}

class AbstractFileSourceImpl extends AbstractFileSource {

    private String parameter;

    public AbstractFileSourceImpl(SourceType type, String parameter) {
        sourceType = type;
        name = parameter;
        this.parameter = parameter;
    }

    @Override
    public String getAbsolutePath() {
        return parameter;
    }

    @Override
    public IDisplayableFileSource getParent() {
        return null;
    }

    @Override
    public boolean addFiles(List<File> fileList, int action) throws IOException {
        return syncList(fileList);
    }

    @Override
    public void updateContent() {
    }
}
